export const pages = (table: any, currentPage: any, pageSize: any) => {
    return table.slice((currentPage - 1) * pageSize, currentPage * pageSize)
}

export function debounce(fn: any, delay = 200) {// fn是需要防抖的函数，delay是延迟多少毫秒执行fn
    let timer: any = null;
    return function () {
        if (timer) {
            clearTimeout(timer);
        }
        timer = setTimeout(() => {
            fn.apply(fn, arguments);
            timer = null;
        }, delay)
    }
}